package com.atzhiguo.springcloud.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhiguo
 * @version v1.0
 * @create 2020/10/20 15:47
 */
@RestController
@RefreshScope //配置上注解 刷新能力
public class ConfigController {

    @Value("${config.info}")
    private String configInfo;

    @GetMapping(value = "/configInfo")
    public String getConfigInfo(){
        return configInfo;
    } //curl -X POST "http://localhost:3355/actuator/refresh" cmd刷新，避免服务重启
}
